'''
Created on 2017-4-14

@author: 24253
'''
from urllib import request
import os,xlrd
from bs4 import BeautifulSoup as BS
import codecs
url="http://china.huanqiu.com/article/2017-04/10478741.html?from=bdwz"

html=request.urlopen(url).read()
soup=BS(html,"lxml")
[s.extract() for s in soup.find_all('script')] 
content=soup.find("div",attrs={"id":"text"}).text



print(content)
    
# value=','.join(str(v) for v in content)
path="d:"+os.sep+"xinwen.txt"
with codecs.open(path,"wb","gbk")as wf:
    wf.write(content)
    
   
        
        
        
    
   